﻿import QtQuick 2.4
   Rectangle {

        id: rectangle1
        signal receiveText(string str)
        signal sendText(string str)
        Rectangle
        {
            anchors.fill: parent
            color:  "red"
            radius: 10
            Rectangle{
                id:reg
                width: 100
                height: 100
                anchors.centerIn: parent
                radius: 50
                color: "#cccccc"
                Text {
                    id: name
                    anchors.centerIn: parent
                    font.pixelSize: 18
                    font.bold: true
                    text: qsTr("")
                }
                MouseArea
                {
                    anchors.fill: parent
                    onClicked:
                    {
                        sendText("123456")
                        name.text = "Send"
                        num.start()
                    }
                }
                NumberAnimation{
                    id:num
                    target: reg
                    property: "scale"
                    from:1
                    to:0.3
                    duration: 2000
                }
                NumberAnimation{
                    id:num1
                    target: reg
                    property: "scale"
                    to:1
                    duration: 2000
                }
            }
        }
        onReceiveText:
        {
            name.text = "Recive"
            console.log("aaaaaaaaaaaaaaaaaaaaaaa")
            num1.start()
        }
    }


